﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="edit.aspx.cs" Inherits="AnyOffice.general.vehicle.checkup.edit" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>车辆使用申请</title>
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<link rel="stylesheet" type="text/css" href="/module/date_selector/popcalendar.css">
		<script src="/module/date_selector/popcalendar.js"></script>
		<script src="/aspnet_client/core/function.js"></script>
		<script Language="JavaScript">
function CheckForm()
{
   if(document.getElementById("ddlVehicleId").value=="")
   {
     alert("请指车辆！");   
     return (false);
   }
   
	if(document.getElementById("txtStartTime").value == "")
	{
		alert("起始时间不能为空！");
		document.getElementById("txtStartTime").focus();
		return (false);
	}

	if(!checkIsDateTime(document.getElementById("txtStartTime").value))
	{
		alert("起始时间不正确！");
		document.getElementById("txtStartTime").focus();
		return (false);
	}
	
	if(document.getElementById("txtEndTime").value == "")
	{
		alert("结束时间不能为空！");
		document.getElementById("txtEndTime").focus();
		return (false);
	}

	if(!checkIsDateTime(document.getElementById("txtEndTime").value))
	{
		alert("结束时间不正确！");
		document.getElementById("txtEndTime").focus();
		return (false);
	}
	
   if (document.getElementById("txtMileage").value !="" && !checkIsDouble(document.getElementById("txtMileage").value))
   { alert("里程应为数字！");
     return (false);
   }
   
   if(document.getElementById("ddlOperator").value == "")
   {
     alert("请指定调度人员！");
     return (false);
   }

  return true;
}

function showDetail()
{
   document.getElementById("ddlDriver").selectedIndex = document.getElementById("ddlVehicleId").selectedIndex;   
   document.getElementById("vehicle_detail").src = "show_detail.aspx?vehicle_id="+document.getElementById("ddlVehicleId").value;
}
		</script>
	</HEAD>
	<body class="bodycolor" topmargin="5">
		<form id="Form1" method="post" runat="server">
			<asp:Panel id="pnlMain" runat="server">
				<TABLE class="small" cellSpacing="0" cellPadding="3" width="100%" border="0">
					<TR>
						<TD class="Big"><IMG height="20" src="/images/notify_new.gif"><SPAN class="big3"> 编辑车辆使用申请</SPAN>
						</TD>
					</TR>
				</TABLE>
				<TABLE class="small" cellSpacing="1" cellPadding="2" width="85%" align="center" bgColor="#000000"
					border="0">
					<TR>
						<TD class="TableContent" noWrap width="80">车 牌 号：</TD>
						<TD class="TableData" width="230">
							<asp:DropDownList id="ddlVehicleId" runat="server" CssClass="BigSelect"></asp:DropDownList></TD>
						<TD class="TableContent" noWrap width="80">司 机：</TD>
						<TD class="TableData" width="230">
							<asp:DropDownList id="ddlDriver" runat="server" CssClass="BigSelect"></asp:DropDownList></TD>
					</TR>
					<TR>
						<TD class="TableContent" noWrap width="80">用 车 人：</TD>
						<TD class="TableData">
							<asp:TextBox id="txtPerson" runat="server" CssClass="BigInput" Columns="20" MaxLength="20"></asp:TextBox></TD>
						<TD class="TableContent" noWrap width="80">用车部门：</TD>
						<TD class="TableData">
							<asp:TextBox id="ToName" runat="server" CssClass="BigStatic" Columns="20" MaxLength="20" ReadOnly="True"></asp:TextBox><INPUT id="ToId" type="hidden" name="ToId" runat="server">&nbsp;<INPUT class="SmallButton" title="选择" onclick="dept_single('ToId','ToName');" type="button"
								value="添 加" name="button">
						</TD>
					</TR>
					<TR>
						<TD class="TableContent" noWrap width="80">起始时间：</TD>
						<TD class="TableData">
							<asp:TextBox id="txtStartTime" runat="server" CssClass="BigInput" Columns="20" MaxLength="20"></asp:TextBox>&nbsp;<IMG style="CURSOR: hand" onclick="popUpCalendar(this,txtStartTime,'yyyy-mm-dd','');"
								src="/module/date_selector/calendar.gif" align="absMiddle" border="0"> <IMG style="CURSOR: hand" onclick="popClock('txtStartTime');" src="/images/menu/clock.gif"
								align="absMiddle" border="0">
						</TD>
						<TD class="TableContent" noWrap width="80">结束时间：</TD>
						<TD class="TableData">
							<asp:TextBox id="txtEndTime" runat="server" CssClass="BigInput" Columns="20" MaxLength="20"></asp:TextBox>&nbsp;<IMG style="CURSOR: hand" onclick="popUpCalendar(this,txtEndTime,'yyyy-mm-dd','');" src="/module/date_selector/calendar.gif"
								align="absMiddle" border="0"> <IMG style="CURSOR: hand" onclick="popClock('txtEndTime');" src="/images/menu/clock.gif"
								align="absMiddle" border="0">
						</TD>
					</TR>
					<TR>
						<TD class="TableContent" noWrap width="80">目 的 地：</TD>
						<TD class="TableData">
							<asp:TextBox id="txtDestination" runat="server" CssClass="BigInput" Columns="20" MaxLength="20"></asp:TextBox></TD>
						<TD class="TableContent" noWrap width="80">里 程：</TD>
						<TD class="TableData">
							<asp:TextBox id="txtMileage" runat="server" CssClass="BigInput" Columns="10" MaxLength="10"></asp:TextBox>(公里)
						</TD>
					</TR>
					<TR>
						<TD class="TableContent" noWrap width="80">申 请 人：</TD>
						<TD class="TableData">
							<asp:TextBox id="txtProposer" runat="server" CssClass="BigStatic" Columns="10" ReadOnly="True"></asp:TextBox></TD>
						<TD class="TableContent" noWrap width="80">调 度 员：</TD>
						<TD class="TableData">
							<asp:DropDownList id="ddlOperator" runat="server" CssClass="BigSelect"></asp:DropDownList></TD>
					</TR>
					<TR>
						<TD class="TableContent" noWrap width="80">事 由：</TD>
						<TD class="TableData" colSpan="3">
							<asp:TextBox id="txtReason" runat="server" CssClass="BigInput" Columns="60" TextMode="MultiLine"></asp:TextBox></TD>
					</TR>
					<TR>
						<TD class="TableContent" noWrap width="80">备 注：</TD>
						<TD class="TableData" colSpan="3">
							<asp:TextBox id="txtRemark" runat="server" CssClass="BigInput" Columns="60" TextMode="MultiLine"></asp:TextBox></TD>
					</TR>
					<TR>
						<TD class="TableContent">提醒调度人员：</TD>
						<TD class="TableData" colSpan="3">
							<asp:CheckBox id="ckbSms" runat="server" Text="使用内部短信" Checked="True"></asp:CheckBox>
							<asp:CheckBox id="ckbMobile" runat="server" Text="使用手机短信" Visible="False"></asp:CheckBox></TD>
					</TR>
					<TR>
						<TD class="TableContent">通知申请人：</TD>
						<TD class="TableData" colSpan="3">
							<asp:CheckBox id="ckbSmsRemind" runat="server" Text="使用内部短信" Checked="True"></asp:CheckBox>
							<asp:CheckBox id="ckbMobileRemind" runat="server" Text="使用手机短信" Visible="False"></asp:CheckBox></TD>
					</TR>
					<TR class="TableControl">
						<TD noWrap align="center" colSpan="4"><INPUT class="BigButton" onclick="return CheckForm();" type="submit" value="保存">&nbsp;&nbsp;
							<INPUT class="BigButton" type="reset" value="重填">&nbsp;&nbsp;
						</TD>
					</TR>
				</TABLE>
				<BR>
				<DIV align="center"><IFRAME id="vehicle_detail" align="middle" src="" frameBorder="0" width="85%" scrolling="no"
						height="200"></IFRAME>
				</DIV>
				<SCRIPT>
			if(document.getElementById("ddlVehicleId").value != "")
				document.getElementById("vehicle_detail").src="../show_detail.aspx?vehicle_id="+document.getElementById("ddlVehicleId").value;
				</SCRIPT>
			</asp:Panel>
			<asp:Literal id="litMessage" runat="server"></asp:Literal>
		</form>
	</body>
</HTML>
